package video.threaddemo.runnable;

import java.util.concurrent.*;

public class RunnableMain {
    public static void main(String[] args) throws Exception {
        ExecutorService threadExecutor = Executors.newSingleThreadExecutor();

         threadExecutor.submit(new RunnableDemo("abc"));

        boolean b = threadExecutor.awaitTermination(2, TimeUnit.SECONDS);
        System.out.println(b);
        threadExecutor.shutdown();
        System.out.println(threadExecutor.isTerminated());
        System.out.println(threadExecutor.isShutdown());
    }
}
